<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>粮油集团办公自动化协作平台</title>
		<link href="<%=basePath %>style/txlz7.css" rel="stylesheet" type="text/css" />
		<link href="<%=basePath %>ajaxFramework/ext-2.1/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/adapter/ext/ext-base.js"></script>
		<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/ext-all.js"></script>
		<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/source/locale/ext-lang-zh_CN.js"></script>
		<script type="text/javascript" src="<%=basePath %>ajaxFramework/jQuery/jquery.js"></script>
		<script type="text/javascript" src="<%=basePath %>js/common/global/validator.js"></script>
		<script type="text/javascript" src="<%=basePath %>js/common/global/pageControl.js"></script>
		<style>
			#right .contabwd_02 {
				width: 99%;
				margin-top: 6px;
				border: 1px #9DB0BC solid;
				background: #fff;
				height: 99%;
				float: left;
			}
		</style>
		<script type="text/javascript">
			var i =0
			$(function(){
				$.ajaxSetup({
				  async: false
				  }); 
				$("input[name='dutyName']").change(issamedutyName);
				$(".s09 >a").attr("href","javascript:formsubmit()");
			});
			function issamedutyName(){
				var dutyName = $.trim($("input[name='dutyName']").attr('value'));
				var start = true;
				$.get("<%=basePath%>tjsinfo/tjsoa/system/issamedutyname.do",{dutyName:dutyName},function(data){
					if(data == 'false'){
						start = false;
						Ext.MessageBox.alert('提示信息', '职位名称不能重复',function(){
							$("input[name='dutyName']").select();	
						});
								
					}
				});	
				return start;
			}
			function formsubmit(){
				if(isnull("input[name='dutyName']","职位名称不能为空")&&issamedutyName()){
					if(!isnullnotmessage("input[name='jibie']"))
					{
						if(!mustisnumber("input[name='jibie']","级别必须为正整数"))
						{
							return 
						}	
						else
						{
							var dutyName = $.trim($("input[name='dutyName']").attr('value'));
							$("input[name='dutyName']").attr('value',dutyName);
							msg();
							$("form[name='form1']").submit();
						}
					}
					else
					{
						var dutyName = $.trim($("input[name='dutyName']").attr('value'));
						$("input[name='dutyName']").attr('value',dutyName);
						msg();
						$("form[name='form1']").submit();
					}
					
				}	
			}	
		</script>
	</head>
	
	<body>
		<form action="<%=basePath %>tjsinfo/tjsoa/system/addDuty.do" method="post" name="form1">
			<div style="height: 98%">
				<div id="right">
					<div class="p_01">
						<ul>
							<li class="s09">
								<a href="#">提交</a>
							</li>
							<li>
								<a href="<%=basePath %>system/duty/dutylist.jsp?fanhui=true">返回</a>
							</li>
						</ul>
					</div>
					<table width="100%" border="0" cellspacing="0" cellpadding="0" height="95%">
						<tr>
							<td width="100%" valign="top" height="100%">
								<div class="contabwd_02">

									<div class="gwlz01">
										<table width="399" border="0" cellspacing="0" cellpadding="0"
											align="center">
											  <tr>
					                            <td><img src="<%=basePath %>images/lwxx_15.gif" /></td>
					                          </tr>
											<tr>
												<td>
													<div class="lwxx">
														<table width="361" height="271" border="0" align="center"
															cellpadding="0" cellspacing="0" class="ttaa">
															<tr>
																<td width="80" align="right">
																	<img src="<%=basePath %>images/dfdf_03.gif" />&nbsp;职位名称
																</td>
																<td width="258" align="right">
																	<input name="dutyName" type="text" size="44" maxlength="30" style="border: 1px #C0C0C0 solid; background: #F4F4F4; height: 19px" />
																</td>
																<td width="23">
																	&nbsp;
																</td>
															</tr>
															<tr>
																<td width="80" align="right">
																	<img src="<%=basePath %>images/dfdf_03.gif" />&nbsp;描述
																</td>
																<td width="258" align="right">
																	<input name="dutyDes" type="text" size="44" maxlength="50" style="border: 1px #C0C0C0 solid; background: #F4F4F4; height: 19px" />
																</td>
																<td width="23">
																	&nbsp;
																</td>
															</tr>
															<tr>
																<td width="80" align="right">
																	<img src="<%=basePath %>images/dfdf_03.gif" />&nbsp;级别
																</td>
																<td width="258" align="right">
																	<input name="jibie" value="" type="text" size="44" maxlength="5" style="border: 1px #C0C0C0 solid; background: #F4F4F4; height: 19px" />
																</td>
																<td width="23">
																	&nbsp;
																</td>
															</tr>
														</table>
													</div>
												</td>
											</tr>
											<tr>
					                            <td><img src="<%=basePath %>images/lwxx_03.gif" /></td>
					                          </tr>
										</table>
									</div>
									<div style="display: none">
										<div id="rolesdiv"></div>
									</div>
								</div>
							</td>
						</tr>
					</table>
				</div>
			</div>
			<input type="hidden" id="basePath" value="<%=basePath%>" />
		</form>
	</body>
</html>
